let dbm = require('../db/index.js');
let moment = require('moment');
let p = dbm.post_comment;

let comment = {

	async list(post_id){
		return p.find();
	},

	async add(info){
		info['comment_date'] = moment().format('x');
		return p.insert(info);
	},

	async del(pid){
		return p.remove({_id:dbm.id(pid)});
	},
}

module.exports = comment;